/**
 * Copyright: Copyright (c) 2012
 * Company:anhosi.com
 * @author lifuyu
 * @date Aug 12, 2012
 * @version V1.0
 *
 * @Description: 
 */
package com.microcm.system.action;

import org.springframework.stereotype.Controller;

import com.microcm.common.Final;
import com.microcm.system.entity.SessionUnit;
import com.microcmframework.core.action.BaseAction;

/**
 * @author kansum
 * 
 *         处理登录，登出
 */
@Controller("loginoutAction")
public class LoginoutAction extends BaseAction
{
	private static final long serialVersionUID = 1L;

	/**
	 * 管理员登录
	 * 
	 * @author：lifuyu
	 * 
	 * @return
	 * @throws Exception
	 */
	public String managerLogin() throws Exception
	{
		SessionUnit su = new SessionUnit();
		su.setUid("999999999");
		su.setStatus(1);
		this.getSession().put(Final.ONLINE_MGR_FLAG, su);

		return this.sendRespJsonValue(SUCCESS, "OK");
	}

	/**
	 * 管理员登录
	 * 
	 * @author：lifuyu
	 * 
	 * @return
	 * @throws Exception
	 */
	public String managerLogout() throws Exception
	{
		this.getSession().remove(Final.ONLINE_MGR_FLAG);

		return this.sendRespJsonValue(SUCCESS, "OK");
	}
}
